package com.fyzk.activity.setting;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.TextView;

import com.tyjc.lottery.R;
import com.fyzk.net.PublicMethod;

import java.io.InputStream;

public class HelpsDialog extends Activity{
	
	private Intent intent = null;
	
	private ImageView back;
	private TextView top_title;
	private TextView content;
	
	private String titleStr = "";
	private String contentStr = "";
	
	private InputStream inputStream;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.helpsdialog);
		info();
	}
	
	@Override
	protected void onStart() {
		super.onStart();
		intent = getIntent();
		titleStr = intent.getStringExtra("title");
		inputStream = getResources().openRawResource(intent.getIntExtra("content", R.raw.helps));
		contentStr = PublicMethod.getStringFromStream(inputStream);
		top_title.setText(titleStr);
		content.setText(contentStr);
	}
	
	private void info(){
		back = (ImageView)findViewById(R.id.helpsdialog_top_iv_back);
		top_title = (TextView)findViewById(R.id.helpsdialog_top_title);
		content = (TextView)findViewById(R.id.helpsdialog_content);
		back.setOnClickListener(new OnClickListener() {
			
			@Override
			public void onClick(View v) {
				onBackPressed();
			}
		});
	}
	
}
